<%--
  Created by IntelliJ IDEA.
  User: tugou
  Date: 2017/5/9
  Time: 22:31
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"
          name="viewport" id="viewport">
    <title>修改信息</title>
    <script src="<%=basePath%>js/jquery.min.js"></script>
    <script src="<%=basePath%>js/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/main.css">
    <script>
        function sumbit() {
            var olderPaw = $("#olderPaw").val();
            if (olderPaw.length == 0) {
                showDialog("原密码不能为空!");
                return false;
            }
            var password = $("#password").val();
            var surePassword = $("#surePassword").val();
            if (password.length == 0) {
                showDialog("密码不能为空!");
                return false;
            }
            if (password.length < 6) {
                showDialog("密码长度不能小于6位!");
                return false;
            }
            if (surePassword.length == 0) {
                showDialog("确认密码不能为空!");
                return false;
            }
            if (password != surePassword) {
                showDialog("两次密码输入不一致!");
                return false;
            }
            var readName = $("#readName").val();
            if (readName.length == 0) {
                showDialog("真实姓名不能为空!");
                return false;
            }
             $("#addUser").submit();
        }
        var msg = "${msg.errmsg}";
        if (msg != null && msg != "") {
            showDialog(msg);
        }
        function showDialog(msg) {
            layer.msg(msg, {
                time: 20000, //20s后自动关闭
                btn: ['确定']
            });
        }
    </script>
</head>
<body>
<header>

    <h1><a href="./index.html">报名学车管理后台</a></h1>

</header>
<div id="user_nav">
    <h1>${sysuser.userName}</h1>
    <h2>
        <c:if test="${sysuser.userType == 1}">
            系统管理员
        </c:if>
        <c:if test="${sysuser.userType == 2}">
            运营人员
        </c:if>
    </h2>
    <a href="<%=basePath%>admin/loginOut"><h3>退出</h3></a>
</div>
<div id="sidebar">
    <ul>
        <li><a href="<%=basePath%>sys/index/1"><i class="icon icon_home"></i><span>首页</span></a></li>
        <li class="active"><a href="<%=basePath%>sys/userList"><i class="icon icon_users"></i><span>人员管理</span></a></li>
        <li><a href="<%=basePath%>sys/getStudentList"><i
                class="icon icon_chapter"></i><span>学员信息管理</span></a></li>
        <li><a href="<%=basePath%>sys/examsPage"><i class="icon icon_exams"></i><span>学车点管理</span></a></li>
        <li><a href="<%=basePath%>sys/settingPage"><i class="icon icon_setting"></i><span>网站设置</span></a></li>
    </ul>
</div>
<div id="content">
    <div class="title_h1">
        <h1>修改密码</h1>
    </div>
    <div class="box_silde">
        <menu id="myTab1">
            <li class="active" onMouseOver="nTabs(this,0)" ;><em class="icon_user_add"></em>修改密码</li>
        </menu>
        <form action="<%=basePath%>sys/commitChange" id="addUser" method="post">
            <input type="hidden" value="${sysuser.id}" name="id">
            <div class="TabContent">
                <div id="myTab1_Content0">
                    <ul>
                        <li>
                            <label class="box_silde_label">真实姓名：</label>
                            <input class="box_silde_controls" type="text" name="userName" value="${sysuser.userName}"
                                   id="readName" disabled/>
                        </li>
                        <li>
                            <label class="box_silde_label">原密码：</label>
                            <input class="box_silde_controls" type="password" name="olderPassword"
                                   id="olderPaw"/>
                            请输入原密码
                        </li>
                        <li>
                            <label class="box_silde_label">密码：</label>
                            <input class="box_silde_controls" type="password" name="userPwd" id="password"/>
                            密码应为长度在6-20位之间，不为空格的字符
                        </li>
                        <li>
                            <label class="box_silde_label">确认密码：</label>
                            <input class="box_silde_controls" type="password" id="surePassword"/>
                            重复密码必须和之前的密码一致
                        </li>
                    </ul>
                    <button type="button" class="btn_save" onclick="sumbit()">提交</button>
                </div>
            </div>
        </form>
    </div>
    <footer>© 2017 All Rights Reserved</footer>
</div>
</body>
</html>
